import smtplib
import sys
from email.mime.text import MIMEText
from email.header import Header
from_addr = 'liruilong108@foxmail.com'
password = 'xznjnyvgnvmuicji'
to_addr = sys.argv[1]
smtp_server = 'smtp.qq.com'
msg = MIMEText(
    '<p class="ql-align-justify"><strong>尊敬的<u>&nbsp;&nbsp;&nbsp;' + sys.argv[
        2] + '&nbsp;&nbsp;&nbsp;</u>女士/先生：</strong></p><p class="ql-align-justify">	感谢您在为平安有限公司做出的贡献，祝您前程美好！</p>' +
    '<p class="ql-align-center"><img src=""></p>'
    , 'HTML', 'utf-8')
msg['From'] = Header(from_addr)
msg['To'] = Header(to_addr)
msg['Subject'] = Header(sys.argv[3])
server = smtplib.SMTP_SSL()
server.connect(smtp_server, 465)
server.login(from_addr, password)
server.sendmail(from_addr, to_addr, msg.as_string())
server.quit()
